<?php

namespace IDock\Insurance\TPBX\Request;

use Exception;
use IDock\Insurance\TPBX\Request\AllTPBXRequest;
use IDock\Insurance\TPBX\Response\ProposalStatusResponse;
use IDock\Visitor\PolicyInfoVisitor;
use IDock\Visitor\ProposalStatusVisitor;

class ProposalStatusRequest extends AllTPBXRequest
{
    /**
     * @var  ProposalStatusVisitor $visitor
     */
    protected $visitor;

    public $route = 'webapi/v1/orderInfo/query';

    public $requestType = 'V305';

    protected $response = ProposalStatusResponse::class;

    protected $urlTip = '保单详情查询';

    public $userName = '';

    /**
     * @return array
     */
    public function generate(): array
    {
        return [
            'basePart' => [
                'applyPolicyNo' => $this->visitor->biInquiryNo ?: $this->visitor->ciInquiryNo
            ],
        ];
    }
}
